<?php

class Languages extends FRM_Db_Table   
{
	/**
	 * Название таблицы
	 *
	 * @var string
	 */
	protected $_name = 'languages';
	
	//public 
	
	function getData()
	{		
		return $this->getList();	
	}
	
	function getDefaultLang()
	{
		return 'ru';$this->getFieldByParam('lang', 'main', '1');
	}
	
	function getLocalLang()
	{
		try {
			$locale = new Zend_Locale('auto');
		} catch (Zend_Locale_Exception $e) {
			$locale = new Zend_Locale('en_US');
		}
		
		$lang = $this->getFieldByParam('lang', 'lang', $locale->getLanguage());
		if($lang == "") {			
			return $this->getDefaultLang();
		}
		else {			
			return $locale->getLanguage();
		}
		
	}
	
	public function init()
	{
     	parent::init();
	}
	
}